public class num300 {
    public int lengthOfLIS(int[] nums) {
        if(nums.length == 1) {
            return 1;
        }
        int[] arr = new int[nums.length];
        arr[0] = 1;
        int maxcount = 1;
        for (int i = 1; i < nums.length; i++) {
            arr[i] = 1;
            for (int j = 0; j < i; j++) {
                if(nums[i] > nums[j]) {
                    arr[i] = Math.max(arr[i],arr[j] + 1);
                }
                maxcount = Math.max(maxcount,arr[i]);
            }
        }
        return maxcount;
    }
}
